home *** CD-ROM | disk | FTP | other *** search
- # correct the names of the directory of a uncompressed untared !x-ed file
- # under unix with gawk
- # gawk -f correctnames.gawk _files/nameslist
- /^/ {
- if (NF==3)
- {
- aind=split($2,a,".");
- if (aind!=0)
- {
- string1=a[2];
- for (i=3;i<=aind;i++)
- string1=sprintf("%s/%s",string1,a[i]);
- }
- aind=split($3,a,".");
- if (aind!=0)
- {
- string2=a[2];
- for (i=3;i<=aind;i++)
- string2=sprintf("%s/%s",string2,a[i]);
- }
- sysstr=sprintf("mv %s %s\n",string1,string2);
- system(sysstr);
- }
- }
-